package com.example.lte.second.service;

import com.example.lte.second.service.impl.CashSenderImpl;
import com.example.lte.second.service.impl.PointSenderImpl;
import com.example.lte.second.service.impl.VirtualSenderImpl;

/**
 * @author lzh
 * @date 2020/11/19 - 13:55
 */
public class SenderStrategy {

    public static void doSendPrize(SendPrizeReq req){
        IPrizeSender prizeSender = new CashSenderImpl();
        IPrizeSender prizeSender2 = new VirtualSenderImpl();
        IPrizeSender prizeSender3 = new PointSenderImpl();
        if (prizeSender.support(req)) {
            prizeSender.sendPrize(req);
        }
        if (prizeSender2.support(req)) {
            prizeSender2.sendPrize(req);
        }
        if (prizeSender3.support(req)) {
            prizeSender3.sendPrize(req);
        }
    }

}
